package first.endtoend

import first.endtoend.Product

/*
this service is related to product
 */

class ProductService
{

    def serviceMethod()
    {

    }

    def toJson(Product product)
    {

        if (product)
        {
            [
                    id          : product.id,
                    pricePerUnit: product.pricePerUnit,
                    description : product.description,
                    iconURL     : product.iconURL,
                    unity       : product.unity,
                    name        : product.name

            ]

        } else
        {
            println("product doesnt exist! ")
        }

    }


}

